import { Controller, Get, Req } from '@nestjs/common';
import { Rebates_Service } from '../rebates/rebates.service';
import { ApiTags } from '@nestjs/swagger';
import { util_ApiResponse_Base } from '@/common/util/apiResponse';
import { util_Index_ReturnContent } from '@/common/util/index';
import { IRequest } from '@/common/typeScripts';
import { RebatesWeb_Find_Dto } from '../rebates/assets/rebates.dto';

@Controller('/web/rebatesWeb')
@ApiTags('rebatesWeb 返利订单记录')
export class RebatesWeb_Controller {
  constructor(private readonly rebates_Service: Rebates_Service) {}

  @Get('/detail')
  @util_ApiResponse_Base({
    dataType: 'dataType_object',
    summary: '返现总览',
  })
  async rebatesWeb_UserClientDetail(@Req() req: IRequest) {
    return util_Index_ReturnContent(await this.rebates_Service.rebatesWeb_UserClientDetail(req));
  }

  @Get('/orderDetail')
  @util_ApiResponse_Base({
    dataType: 'dataType_object',
    summary: '推广总览',
  })
  async rebatesWeb_OrderDetail(@Req() req: IRequest) {
    return util_Index_ReturnContent(await this.rebates_Service.rebatesWeb_OrderDetail(req));
  }

  @Get('/orderList')
  @util_ApiResponse_Base({
    dataType: 'dataType_list',
    summary: '推广订单列表',
  })
  async rebatesWeb_OrderList(@Req() req: IRequest, query: RebatesWeb_Find_Dto) {
    return util_Index_ReturnContent(await this.rebates_Service.rebatesWeb_OrderList(req, query));
  }
}
